/*
 * Created by JFormDesigner on Fri Nov 15 11:30:03 CST 2024
 */

package com.hafu.view;

import com.hafu.view.GYS.AddGYSFrm;
import com.hafu.view.GYS.ManageGYSFrm;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.GroupLayout;

/**
 * @author aa
 */
public class MainFrm extends JFrame {
    public MainFrm() {
        initComponents();
    }

    private void button1(ActionEvent e) {
        // TODO add your code here
        AddGYSFrm addGYSFrm = new AddGYSFrm();
        addGYSFrm.setVisible(true);
    }

    private void button2(ActionEvent e) {
        // TODO add your code here
        ManageGYSFrm manageGYSFrm = new ManageGYSFrm();
        manageGYSFrm.setVisible(true);
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        button1 = new JButton();
        button2 = new JButton();

        //======== this ========
        Container contentPane = getContentPane();

        //---- button1 ----
        button1.setText("\u6dfb\u52a0\u4f9b\u5e94\u5546");
        button1.addActionListener(e -> button1(e));

        //---- button2 ----
        button2.setText("\u4f9b\u5e94\u5546\u7ba1\u7406");
        button2.addActionListener(e -> button2(e));

        GroupLayout contentPaneLayout = new GroupLayout(contentPane);
        contentPane.setLayout(contentPaneLayout);
        contentPaneLayout.setHorizontalGroup(
            contentPaneLayout.createParallelGroup()
                .addGroup(contentPaneLayout.createSequentialGroup()
                    .addGap(46, 46, 46)
                    .addComponent(button1)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 83, Short.MAX_VALUE)
                    .addComponent(button2)
                    .addGap(113, 113, 113))
        );
        contentPaneLayout.setVerticalGroup(
            contentPaneLayout.createParallelGroup()
                .addGroup(contentPaneLayout.createSequentialGroup()
                    .addGap(103, 103, 103)
                    .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(button1)
                        .addComponent(button2))
                    .addContainerGap(135, Short.MAX_VALUE))
        );
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    private JButton button1;
    private JButton button2;
    // JFormDesigner - End of variables declaration  //GEN-END:variables
}
